home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11246 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  32 lines

  1. Newsgroups: comp.lang.c
  2. Path: uu4news.netcom.com!zodiac!szh
  3. From: szh@zcon.com (Syed Zaeem Hosain)
  4. Subject: Re: given: char foo[80]; there is no such thing as element foo[80] correct? (i.e. foo[80] = '\0' is beyond the array boundary)
  5. Message-ID: <1996Mar22.180530.27923@zcon.com>
  6. Sender: szh@zcon.com (Syed Zaeem Hosain)
  7. Nntp-Posting-Host: zodiac
  8. Reply-To: szh@zcon.com
  9. Organization: Z Consulting Group
  10. References: <4ithke$mql@hermes.acs.unt.edu>
  11. Date: Fri, 22 Mar 1996 18:05:30 GMT
  12.  
  13. In article <4ithke$mql@hermes.acs.unt.edu>, johnw@jove.acs.unt.edu (John R. Williams) writes:
  14. >Syed Zaeem Hosain (szh@zcon.com) wrote:
  15. >> >// Yes. This works nice and safely for any array of known size.
  16. >> >foo[sizeof(foo)-1] = '\0';
  17. >
  18. >This is not safe even for strings if your character type is not 
  19. >'char'. I know that sounds silly, but wchar_t *is* there for a reason, 
  20. >y'know.
  21.  
  22. Careful with your editing, please! I did *not* write the above.
  23.  
  24.                                 Z
  25.  
  26.  
  27. -- 
  28. -------------------------------------------------------------------------
  29. | Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
  30. | Z Consulting Group        San Jose, CA 95161             szh@zcon.com |
  31. -------------------------------------------------------------------------
  32.